package com.ljx.thread.thread03;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2022/11/1 9:40
 * @Version 1.0
 */
public class TestSleep {
	public static void main(String[] args) {
		SleepThread sleepThread=new SleepThread();
		sleepThread.start();
	}
}

class SleepThread extends Thread{
	@Override
	public void run() {
		for (int i = 0; i < 20; i++) {
			try {
				/**
				 * 让当前线程休眠1秒
				 */
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(Thread.currentThread().getName()+"~~~~~~~~~");
		}
	}
}